home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!usenet
- From: GHouck <hksys@teleport.com>
- Newsgroups: comp.lang.c
- Subject: Re: File problem with Watcom C/C++ 10.5
- Date: 8 Apr 1996 20:28:08 GMT
- Organization: systems hk
- Message-ID: <4kbsso$sjl@nadine.teleport.com>
- References: <4k9fds$4fs@sparcserver.lrz-muenchen.de>
- NNTP-Posting-Host: ip-pdx03-45.teleport.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- Ralph Reichart <reichart@informatik.tu-muenchen.de> wrote:
- >i have a big problem. i'm trying to open a file with fopen. the program
- >looks like this:
- >
- >#include <stdlib.h>
- >#include <stdio.h>
- >
- >main()
- >{
- > FILE *Datei;
- >
- > Datei = fopen("\autoexec.bat", "r");
- > if (Datei == NULL)
- > {
- > printf("\nSHIT!!");
- > exit(1);
- > };
- > fclose(Datei);
- >}
- >
- >i'm sorry, but i can't open it. i always have the value -1 or 1 in errno.
- Ralph,
-
-
- You need a double-backslash in your file-specifications, since a single one
- is taken as the escape character (\a):
-
- fopen( "\\autoexec.bat","r" );
-
- will result in a single-backslash in the string.
-
- Yours, Geoff Houck
-
-